home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 21
/
CU Amiga Magazine's Super CD-ROM 21 (1998)(EMAP Images)(GB)[!][issue 1998-04].iso
/
CUCD
/
Programming
/
RTGMaster
/
demos
/
moon
/
ihandler.a
< prev
next >
Wrap
Text File
|
1996-10-08
|
3KB
|
93 lines
;
; ihandler.a V1.3
;
;
; Input Handler for RTGGadgets package
;
; Copyright © 1996 by Thomas and Hans-Joerg Frieden
; Written by Thomas and Hans-Joerg Frieden
;
; This software may be freely distributed. The copyright remains with
; the copyright holders. For further information, see legal.doc
; In no way may this software be modified without permission of the
; copyright holders.
;
; This software is provided "as is", and may only be used at your own risk.
; The copyright holder and/or the authors can not be held responible for any
; damage the usage of this software may cause. To put it in other words, we are not
; responisble if your cat dies while using this software.
include "include:exec/types.i"
include "include:exec/io.i"
include "include:devices/inputevent.i"
STRUCTURE RTGInpRec,0
UBYTE ir_MK1 ; Linke Maustaste
UBYTE ir_MK2 ; Mittlere Maustaste
UBYTE ir_MK3 ; Rechte Maustaste
UBYTE ir_UK1 ; Linke Maustaste
UBYTE ir_UK2 ; Mittlere Maustaste
UBYTE ir_UK3 ; Rechte Maustaste
UBYTE ir_LastKey ; Letzte gedrückte Taste
STRUCT ir_Keys,$60 ; Tasten-Array
WORD ir_MouseX ; X-Mauscoordinate
WORD ir_MouseY ; Y-Mauscoordinate
LABEL ir_SIZEOF
section text,code
;
; Input Handler Code
;
xdef _HandlerCode
;
; A0 enthält InputEvent-Kette
; A1 enthält den Pointer auf das Daten-Feld
;
; D0 enhält die (neue) Event-Kette beim Verlassen der Funktion.
; Wird in diesem Handler auf NULL gesetzt, damit keine Events
; zu Intuition durchkommen (ich sind da ein wenig eigen)
;
_HandlerCode:
move.l a0,-(sp)
_HandlerCodeLoop:
cmp.b #IECLASS_RAWMOUSE,ie_Class(a0) ; Hat jemand gemaust?
bne.s hc_nomouse ; Nö, keine Maus
cmp.w #IECODE_LBUTTON,ie_Code(a0) ; Linke Taste ?
bne.s hc_lutest ; nope
move.b #1,ir_MK1(a1)
bra hc_NextEvent
hc_lutest:
cmp.w #IECODE_LBUTTON+IECODE_UP_PREFIX,ie_Code(a0) ; Linke Taste hoch ?
bne.s hc_rdtest ; nope
move.b #1,ir_UK1(a1)
bra hc_NextEvent
hc_rdtest:
bra hc_NextEvent
hc_nomouse:
cmp.b #IECLASS_RAWKEY,ie_Class(a0) ; Tastendruck?
bne.s hc_NextEvent ; Nee, nächsten Event bearbeiten
move.w ie_Code(a0),d0 ; Code rauslesen
btst #7,d0 ; War's ein UP_PREFIX
beq hc_noup ; Nö. keiner
moveq #0,d1
bra.s hc_setkey
hc_noup:
moveq #1,d1
move.b d0,ir_LastKey(a1) ; LastKey setzten
hc_setkey:
and.w #$7f,d0 ; evn. UP_PREFIX löschen
move.b d1,(a1,d0.w) ; Key-Merker setzten
hc_NextEvent:
move.l (a0),d0
move.l d0,a0
bne.s _HandlerCodeLoop
move.l (sp)+,d0
rts
END